import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: resolve => require(['@/pages/Index/Index'], resolve)
    }, {
      path: '/index',
      name: 'Index',
      component: resolve => require(['@/pages/Index/Index'], resolve)
    }, {
      path: '/product',
      name: 'Product',
      component: resolve => require(['@/pages/Product/Product'], resolve)
    }, {
      path: '/company',
      name: 'Company',
      component: resolve => require(['@/pages/Company/Company'], resolve),
      children: [
        {
          path: 'about',
          name: 'About',
          component: resolve => require(['@/pages/Company/About'], resolve)
        }, {
          path: 'news',
          name: 'News',
          component: resolve => require(['@/pages/Company/News'], resolve)
        }, {
          path: '',
          redirect: '/company/about'
        }
      ]
    }, {
      path: '/cooperation',
      name: 'Cooperation',
      component: resolve => require(['@/pages/Cooperation/Cooperation'], resolve)
    }, {
      path: '',
      redirect: '/index'
    }
  ]
})
